﻿namespace WMS6.Web.Outbound
{
    using System;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;
    using WMS6.Web.UserControls;

    public class PickDetailQuery : BasePage
    {
        protected Button btnExport;
        protected Button btnList;
        protected Button btnSearch;
        protected DropDownList ddlExternalLotOper;
        protected DropDownList ddlExternOrderID;
        protected DropDownList ddlFromLocOper;
        protected DropDownList ddlLotOper;
        protected DropDownList ddlLpnIDOper;
        protected DropDownList ddlOrderID;
        protected DropDownList ddlOwnerID;
        protected DropDownList ddlReferenceNum;
        protected DropDownList ddlSkuID;
        protected DropDownList ddlStatus;
        protected DropDownList ddlToLocOper;
        protected DropDownList ddlVendorIDOper;
        protected DropDownList ddlWaveID;
        protected HtmlForm F7050;
        protected HtmlInputHidden hdnActionID;
        protected Label lblExternalLot;
        protected Label lblExternOrderID;
        protected Label lblFromLoc;
        protected Label lblLot;
        protected Label lblLpnID;
        protected Label lblOrderID;
        protected Label lblOwnerID;
        protected Label lblPickDetailQuery;
        protected Label lblReferenceNum;
        protected Label lblSkuID;
        protected Label lblStatus;
        protected Label lblToLoc;
        protected Label lblVendorID;
        protected Label lblWaveID;
        protected MultipleSelectControl MSCStatus;
        protected HtmlLink mycss;
        protected ScriptManager ScriptManager1;
        protected TextBox txtExternalLot;
        protected TextBox txtExternOrderID;
        protected TextBox txtFromLoc;
        protected TextBox txtLot;
        protected TextBox txtLpnID;
        protected TextBox txtOrderID;
        protected TextBox txtOwnerID;
        protected TextBox txtReferenceNum;
        protected TextBox txtSkuID;
        protected TextBox txtToLoc;
        protected TextBox txtVendorID;
        protected TextBox txtWaveID;

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer("PickDetailList.aspx", false);
        }

        private void LoadData()
        {
            base.BindData2DDLBySysCode(this.MSCStatus, "PickDetailStatus");
            base.InitQueryDDL(this.ddlSkuID, 0);
            base.InitQueryDDL(this.ddlOrderID, 0);
            base.InitQueryDDL(this.ddlOwnerID, 0);
            base.InitQueryDDL(this.ddlExternOrderID, 0);
            base.InitQueryDDL(this.ddlStatus, 0);
            base.InitQueryDDL(this.ddlWaveID, 0);
            base.InitQueryDDL(this.ddlLotOper, 0);
            base.InitQueryDDL(this.ddlFromLocOper, 0);
            base.InitQueryDDL(this.ddlToLocOper, 0);
            base.InitQueryDDL(this.ddlLpnIDOper, 0);
            base.InitQueryDDL(this.ddlExternalLotOper, 0);
            base.InitQueryDDL(this.ddlVendorIDOper, 0);
            base.InitQueryDDL(this.ddlReferenceNum, 0);
            this.ddlStatus.SelectedValue = "One Of";
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                base.InitPage(this.Page);
                this.LoadData();
            }
        }

        public string ExternalLot
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtExternalLot.Text.Trim()))
                {
                    return base.GetParamsString(this.txtExternalLot.Text.Trim(), this.ddlExternalLotOper.SelectedValue);
                }
                return "";
            }
        }

        public string ExternOrderID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtExternOrderID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtExternOrderID.Text.Trim(), this.ddlExternOrderID.SelectedValue);
                }
                return "";
            }
        }

        public string FromLoc
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtFromLoc.Text.Trim()))
                {
                    return base.GetParamsString(this.txtFromLoc.Text.Trim(), this.ddlFromLocOper.SelectedValue);
                }
                return "";
            }
        }

        public string Lot
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLot.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLot.Text.Trim(), this.ddlLotOper.SelectedValue);
                }
                return "";
            }
        }

        public string LpnID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLpnID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLpnID.Text.Trim(), this.ddlLpnIDOper.SelectedValue);
                }
                return "";
            }
        }

        public string OrderID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOrderID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOrderID.Text.Trim(), this.ddlOrderID.SelectedValue);
                }
                return "";
            }
        }

        public string OwnerID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOwnerID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOwnerID.Text.Trim(), this.ddlOwnerID.SelectedValue);
                }
                return "";
            }
        }

        public string ReferenceNum
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtReferenceNum.Text))
                {
                    return base.GetParamsString(this.txtReferenceNum.Text, this.ddlReferenceNum.SelectedValue);
                }
                return "";
            }
        }

        public string SkuID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtSkuID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtSkuID.Text.Trim(), this.ddlSkuID.SelectedValue);
                }
                return "";
            }
        }

        public string Status
        {
            get
            {
                if (!string.IsNullOrEmpty(this.MSCStatus.ReturnValue))
                {
                    return base.GetParamsString(this.MSCStatus.ReturnValue, this.ddlStatus.SelectedValue);
                }
                return "";
            }
        }

        public string ToLoc
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtToLoc.Text.Trim()))
                {
                    return base.GetParamsString(this.txtToLoc.Text.Trim(), this.ddlToLocOper.SelectedValue);
                }
                return "";
            }
        }

        public string VendorID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtVendorID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtVendorID.Text.Trim(), this.ddlVendorIDOper.SelectedValue);
                }
                return "";
            }
        }

        public string WaveID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtWaveID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtWaveID.Text.Trim(), this.ddlWaveID.SelectedValue);
                }
                return "";
            }
        }
    }
}

